<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 100px;
            background-color: pink;
            /* 名称 */
            animation-name: change;
            /* 动画时长 */
            animation-duration: 1s;
            /* 播放次数 */
            animation-iteration-count: infinite;
        }

        .box:hover {
            animation-play-state: paused;
        }

        @keyframes change {
            0% {
                width: 200px;
            }

            100% {
                width: 800px;
            }
        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>

</html>